package com.org.gsc.chartdemo.activitys;

import android.content.ComponentName;
import android.content.Intent;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;

import com.org.gsc.chartdemo.MainActivity;
import com.org.gsc.chartdemo.R;
import com.org.gsc.chartdemo.adapters.MyAdapter;
import com.org.gsc.chartdemo.bases.BaseActivity;
import com.org.gsc.chartdemo.listeners.OnclickLister;

/**
 * Created by qundui on 2017/8/29.
 */
public class IndexPage extends BaseActivity {
    private MyAdapter mMyAdapter;
    Class cls[]={MainActivity.class,BarAcivity.class,BarHorizontalAcivity.class,PieActivity.class,ScatterActivity.class
    ,BuddleActivity.class,RadarAct.class
    };
    @Override
    protected void doBusy() {
        RecyclerView recyclerView = (RecyclerView) findView(R.id.rv);
        recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        String tags[]={"线形图","柱状图","横向柱状图","饼状图","散点图","气泡图","蜘蛛网图"};
        mMyAdapter = new MyAdapter(tags, this);
        recyclerView.setAdapter(mMyAdapter);
        mMyAdapter.setOnclickLister(new OnclickLister() {
            @Override
            public void OnItemclickLister(int pos, View view) {
                Log.i("gsc","点击了"+pos);
               //" com.tencent.mobileqq.activity.SplashActivity"

                startPage(cls[pos]);
//                if (pos==0){
//                  startPage(MainActivity.class);
//                }
//                if (pos==1){
//                    startPage(BarAcivity.class);
//                }
//                if (pos==2){
//                    startPage(BarHorizontalAcivity.class);
//                }
            }
            @Override
            public void OnItemLongclickListers(int pos, View view) {
                Log.i("gsc","长安了"+pos);
            }
        });

    }

    @Override
    protected int getLayoutId() {
        return R.layout.indexpage;
    }
}
